package com.xiaoyu.client.loader.banner;

import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Color;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.xiaoyu.client.R;
import com.xiaoyu.client.model.StoreCreBanModel;
import com.youth.banner.loader.ImageLoader;

public class StoreImageLoader extends ImageLoader{
    @SuppressLint("Range")
    @Override
    public void displayImage(Context context, Object imgModel, ImageView imageView) {
        //Glide 加载图片简单用法
        StoreCreBanModel banModel = (StoreCreBanModel) imgModel;
        if(banModel.getType()==0){
            Glide.with(context).load(banModel.getPath()).into(imageView);
        }
        if(banModel.getType()==1){
            imageView.setImageResource(R.mipmap.paizhao);
//            imageView.setBackgroundColor(Color.parseColor("#aaaaaa"));
//            imageView.setAlpha((float)102);
//            imageView.setScaleType(ImageView.ScaleType.CENTER);
        }
//        imageView.setImageResource(R.mipmap.icon_shangjia_paizhao);
//        imageView.setImageResource(R.mipmap.img_carousel);

    }
}
